package com.efuture.collection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

/**
 * @ClassNAME CollrctionIterator
 * @Description Collection集合迭代器的使用
 * @Author zhaoshanshan
 * @Date 2021/9/5 5:36 下午
 * @Version 1.0
 */
public class CollrctionIterator {

    public static void main(String[] args) {
        iteratorCollection();
    }
    private static void iteratorCollection(){

        Collection arrayList = new ArrayList();
        arrayList.add("1");
        arrayList.add(1);
        arrayList.add(true);
        arrayList.add(new Object());
        Iterator it = arrayList.iterator();
        while (it.hasNext()){
            Object o = it.next();
            System.out.println(o);
        }
    }
}